#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <wait.h>
#include <stdlib.h>

#include <sys/param.h>

#include <time.h>


int main(int argc, char **argv) {

    int i = 48;
    pid_t pid;

    while (1) {
        sleep(1);
        if ((pid = fork()) < 0) {
            printf("errpr fork!");
            exit(-1);
        }
        argv[1] = (char*) &i;
        if (pid == 0) {
            execv("./chilrd", argv);
        } else if (pid > 0) {
            int status = 0;
            wait(&status);
            printf("child return : %d\n", status);
        }
        i++;
    }


    return 0;
}